class ConfigAttributeError(Exception):
    '''Exeption raised when you try to access to a config dict field witch doesn't exist'''
    def __init__(self, dict,item):
        self.dict = dict
        self.item = item
    def __str__(self):
        return 'Config item ' + self.item + ' not found in config dict ' + self.dict.name
    
class DelEverywhereLocation(Exception):
    """raise when trying to del Everywhere location"""
    def __str__(self):
        return 'Trying to delete the Everywhere Location'
    
class PickleCorruptException(Exception):
    def __init__(self,path):
        self.path = path
    
    def __str__(self):
        return 'Pickle %s was corrupt, DO NOT EDIT PICKLES FILES BY HAND !!!' % self.path
        
class PickleLoadException(Exception):
    def __init__(self,path):
        self.path = path
        
    def __str__(self):
        return 'Could not load %s' % self.path

class ConnexionFailed(Exception):
    def __init__(self,share):
        self.share = share
        
    def __str__(self):
        return 'could not connect to %s :' % self.share.server
    
class DirNotFoundException(Exception):
    def __init__(self,path):
        self.path = path
    
    def __str__(self):
        return '%s not found' % self.path

class MountPointAlreadyInUseException(Exception):
    def __init__(self,share):
        self.share = share
        
    def __str__(self):
        return '%s is already in use' % self.share.mount_point
        
class DirIsNotEmptyException(Exception):
    def __init__(self,path):
        self.path = path
    
    def __str__(self):
        return '%s is not empty' % self.path
    
class ShareAlreadyMountedException(Exception):
    def __init__(self,share):
        self.share = share
    
    def __str__(self):
        return '%s is already mounted' % self.share
    
class SharePathUnreachable(Exception):
    def __init__(self,share):
        self.share = share
    
    def __str__(self):
        return '%s is unreachable' % self.share

class PermissionDenied(Exception):
    def __init__(self,share):
        self.share = share
    
    def __str__(self):
        return 'Permission Denied on %s' % self.share

class InvalidLogin(Exception):
    def __init__(self,share):
        self.share = share
        
    def __str__(self):
        return 'Invalid User or Password on %s' % self.share

class RemoteDirNotFound(Exception):
    def __init__(self,share):
        self.share = share
        
    def __str__(self):
        return 'Remote Dir %s Not Found on %s' % (self.share.path,self.share)

class CantGetHostPubKey(Exception):
    def __init__(self,share):
        self.share = share
    
    def __str__(self):
        return 'Can\'t get %s public host key' % self.share
    
class UnknownHostPubKey(Exception):
    def __init__(self,share,key):
        self.share = share
        self.key = key
    
    def __str__(self):
        return ' %s public key is unknown' % self.share